<%--
  Created by IntelliJ IDEA.
  User: MadFrog
  Date: 2016/11/5
  Time: 17:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
    <title>绑定学号</title>
    <%@include file="_head.jsp"%>
</head>
<body ontouchstart>
<div class="weui_cells weui_cells_form">
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">学号</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" id="xh" placeholder="请输入学号">
        </div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">身份证号</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" id="sfzh" placeholder="请输入身份证号">
        </div>
    </div>
</div>
<div class="weui_cells weui_cells_form">
    <div class="weui_btn_area">
        <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips">确定</a>
    </div>
</div>

<%@include file="_foot.jsp"%>

<script>
    $("#showTooltips").click(function() {
        var xh = $('#xh').val();
        var sfzh = $('#sfzh').val();
        var params = {};
        params.xh = xh;
        params.sfzh = sfzh;
        $.ajax({
            type : "POST",
            url : "bindingStudent",
            data : params,
            dataType : "json",
            success : function (wechatReturn) {
                $.alert(wechatReturn.msg);
                window.location.href = "studentIndex";
            },
            error : function (wechatReturn) {
                $.alert("绑定失败！");
            }
        });
    });
</script>
</body>
</html>
